import { service } from '@/service'

enum Api {
  patamsList = 'hbsys-system/sysParameter/getSysParameter',
  patamsListAdd = 'hbsys-system/sysParameter/saveOrUpdateSysParameter',
  patamsListDel = 'hbsys-system/sysParameter/deleteSysParameter',
  patamsListDetails = 'hbsys-system/sysParameter/detailSysParameter',
  treeList = 'hbsys-system/sysParameter/tree/list',
  treeAdd = 'hbsys-system/sysParameter/tree/addChild',
  valueList = 'hbsys-system/sysParameter/select/info',
  valueAdd = 'hbsys-system/sysParameter/insert/info',
  valueDetails = 'hbsys-system/sysParameter/detailInfo',
  valueDetl = 'hbsys-system/sysParameter/delete/info'
}

export const getParamsList = (params?: any) => {
  return service.request({
    url: Api.patamsList,
    method: 'GET',
    params
  })
}
export const addParamsList = (data?: any) => {
  return service.request({
    url: Api.patamsListAdd,
    method: 'POST',
    data
  })
}
export const editParamsList = (id: number, data?: any) => {
  return service.request({
    url: Api.patamsListAdd,
    method: 'POST',
    data
  })
}

export const delParamsList = (data?: any) => {
  return service.request({
    url: Api.patamsListDel,
    method: 'POST',
    data
  })
}
export const detailsParamsList = (id: number, params?: any) => {
  return service.request({
    url: Api.patamsListDetails + '/' + id,
    method: 'GET',
    params
  })
}
export const getTreeList = (id: any) => {
  return service.request({
    url: Api.treeList + '/' + id,
    method: 'GET'
  })
}
export const addTree = (data: any) => {
  return service.request({
    url: Api.treeAdd,
    method: 'POST',
    data
  })
}
export const paramsValueList = (id: number, params?: any) => {
  return service.request({
    url: Api.valueList + '/' + id,
    method: 'GET',
    params
  })
}
export const paramsValueAdd = (data: any) => {
  return service.request({
    url: Api.valueAdd,
    method: 'POST',
    data
  })
}
export const paramsValueEdit = (id: number, data: any) => {
  return service.request({
    url: Api.valueAdd,
    method: 'POST',
    data
  })
}

export const paramsValueDetails = (id: number, params?: any) => {
  return service.request({
    url: Api.valueDetails + '/' + id,
    method: 'GET',
    params
  })
}
export const paramsValueDel = (data: any) => {
  return service.request({
    url: Api.valueDetl,
    method: 'POST',
    data
  })
}
